<?php
//简单管理页面范例，在你的管理页面引用coresection/checkA.php就OK，当然，不要忘了添加注销登录的链接
include_once '../coresection/checkA.php';
?>

<?
include_once("../../config.php");
$host = $_SERVER['HTTP_HOST']; //取得进入所输入的域名
$theme_folder = host_theme($host);

include_once '../../front/'.$theme_folder.'/connection.php';
?>

<?php include_once("function.php"); ?>
<?php include "../../front/".$theme_folder."/config.php"; ?>

<?php

session_start();

$act = $_REQUEST['act'];

$result = array('error' => 0, 'message' => '', 'content' => '');


//公用模式
global $table_Prefix;


if($act == 'check' ){ 

	$new_detail_url = $_REQUEST['search_url'];	

	$query_check = mysql_query("select count(nid) from ".$table_Prefix . "detail where url = '$new_detail_url'");
	//检查转换的url是否有重复
	$sum_check = mysql_result($query_check, 0);
	
	$term_query_check = mysql_query("select count(nid) from ". $table_Prefix ."term where url = '$new_detail_url'");
	//检查转换的url是否有重复
	$term_sum_check = mysql_result($term_query_check, 0);
	
	if($sum_check>0 || $term_sum_check >0 ){
		$result['error'] = 1;
		$result['message'] = '当前URL已经存在';
		die(json_encode($result));
		exit;	
	}	
	
	$result['error'] = 0;
	$result['message'] = '';
	
	die(json_encode($result));
	exit;	

}
	
	

?>